package sivan.mapper;

import org.springframework.jdbc.core.RowMapper;
import sivan.domain.Person;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by sivan on 2019/3/27.
 */
public class PersonMapper implements RowMapper {

    @Override
    public Person mapRow(ResultSet resultSet, int index) throws SQLException {
        Person person = new Person(resultSet.getInt("id"),resultSet.getString("userName"),
                resultSet.getInt("age"),resultSet.getString("mobilePhone"));
        return person;
    }
}
